home *** CD-ROM | disk | FTP | other *** search
- ; ##########################################################################
- ; #### ####
- ; #### The MusicBox Project ####
- ; #### ============================ ####
- ; #### ####
- ; #### MusicBox_lib.asm ####
- ; #### ####
- ; #### Version 2.1os -- September 29, 2000 ####
- ; #### ####
- ; #### Copyright (C) 1994 Thomas Dreibholz ####
- ; #### 2000 Molbachweg 7 ####
- ; #### 51674 Wiehl ####
- ; #### Germany ####
- ; #### ####
- ; #### EMail: Dreibholz@bigfoot.com ####
- ; #### WWW: http://www.bigfoot.com/~dreibholz ####
- ; #### ####
- ; ##########################################################################
-
- ; ***************************************************************************
- ; * *
- ; * This program is free software; you can redistribute it and/or modify *
- ; * it under the terms of the GNU General Public License as published by *
- ; * the Free Software Foundation; either version 2 of the License, or *
- ; * (at your option) any later version. *
- ; * *
- ; ***************************************************************************
-
- ; MusicBox-Library Grundstruktur
-
- include "exec/types.i"
- include "exec/initializers.i"
- include "exec/libraries.i"
- include "exec/lists.i"
- include "exec/nodes.i"
- include "exec/resident.i"
- include "libraries/dos.i"
- include "exec/alerts.i"
-
-
- CALLSYS MACRO
- jsr _LVO%1(a6)
- endm
-
- XLIB MACRO
- xref _LVO%1
- endm
-
- STRUCTURE MusicBoxLib,LIB_SIZE
- ULONG mbl_SysLib
- ULONG mbl_DosLib
- ULONG mbl_IntLib
- ULONG mbl_FontLib
- ULONG mbl_GfxLib
- ULONG mbl_LocLib
- ULONG mbl_GTLib
- ULONG mbl_VerLib
- ULONG mbl_SegList
- UBYTE mbl_Flags
- UBYTE mbl_Pad
- LABEL MusicBoxLib_SIZEOF
-
- XLIB OpenLibrary
- XLIB CloseLibrary
- XLIB FreeMem
- XLIB Remove
- XLIB Alert
- XLIB CloseCatalog
- XLIB CloseLocale
- XLIB OpenCatalogA
- XLIB OpenLocale
-
- XREF _AddUser
- XREF _RemUser
- XREF _PutCommand
- XREF _CheckResult
- XREF _WaitResult
- XREF _MusicBoxCommand
- XREF _MusicBoxCommand1
- XREF _MusicBoxCommand2
- XREF _InformationA
- XREF _MultiRequestA
- XREF _EasyCommand
- XREF _IconifyMusicBox
- XREF _UnIconifyMusicBox
- XREF _IconifyArchive
- XREF _UnIconifyArchive
- XREF _OpenArchive
- XREF _CreatePort
- XREF _DeletePort
- XREF _CreateExtIO
- XREF _DeleteExtIO
- XREF _NewList
- XREF _GetLStr
- XREF _ErrorL
- XREF _DisplayCatalog
- XREF _CreateProcess
- XREF _MacFormat
- XREF _PutText
- XREF _PutMText
- XREF _OffsetX
- XREF _OffsetY
- XREF _InitSleepPointer
- XREF _RemoveSleepPointer
- XREF _SleepPointer
- XREF _DeleteMMPort
- XREF _SetupPrinter
- XREF _PrintIt
- XREF _CleanUpPort
- XREF _LibVersionCheck
-
- Version equ 38
- Revision equ 2
- Pri equ 5
-
- Start:
- moveq #0,d0
- rts
-
- Resident:
- dc.w RTC_MATCHWORD
- dc.l Resident
- dc.l EndCode
- dc.b RTF_AUTOINIT
- dc.b Version
- dc.b NT_LIBRARY
- dc.b Pri
- dc.l LibName
- dc.l idString
- dc.l Init
-
- LibName: dc.b 'musicbox.library',0
- verID: dc.b '$VER: musicbox.library 2.1os (Sep 29 2000) - Copyright (C) 1994-2000 by Thomas Dreibholz',0
- idString: dc.b 'musicbox.library 38.2 (Sep 29 2000)',13,10,0
- DosName: dc.b 'dos.library',0
- IntName: dc.b 'intuition.library',0
- GfxName: dc.b 'graphics.library',0
- FontName: dc.b 'diskfont.library',0
- LocName: dc.b 'locale.library',0
- GTName: dc.b 'gadtools.library',0
- CatName: dc.b 'musicbox.catalog',0
- VerName: dc.b 'version.library',0
- even
- public _SleepPointerData
- _SleepPointerData:
- dc.w 0,0
- dc.w %0000011000000000,%0000011000000000
- dc.w %0000111101000000,%0000111101000000
- dc.w %0011111111100000,%0011111111100000
- dc.w %0111111111100000,%0111111111100000
- dc.w %0111111111110000,%0110000111110000
- dc.w %0111111111111000,%0111101111111000
- dc.w %1111111111111000,%1111011111111000
- dc.w %0111111111111100,%0110000111111100
- dc.w %0111111111111100,%0111111100001100
- dc.w %0011111111111110,%0011111111011110
- dc.w %0111111111111100,%0111111110111100
- dc.w %0011111111111100,%0011111100001100
- dc.w %0001111111111000,%0001111111111000
- dc.w %0000011111110000,%0000011111110000
- dc.w %0000000111000000,%0000000111000000
- dc.w %0000011100000000,%0000011100000000
- dc.w %0000111111000000,%0000111111000000
- dc.w %0000011010000000,%0000011010000000
- dc.w %0000000000000000,%0000000000000000
- dc.w %0000000011000000,%0000000011000000
- dc.w %0000000011100000,%0000000011100000
- dc.w %0000000001000000,%0000000001000000
- dc.w 0,0
- _SleepPointerEnd:
- public _SleepPointerSize
- _SleepPointerSize:
- dc.l _SleepPointerEnd-_SleepPointerData
- even
-
- EndCode:
-
- Init:
- dc.l MusicBoxLib_SIZEOF
- dc.l FuncTable
- dc.l DataTable
- dc.l InitRoutine
-
- FuncTable:
- dc.l Open
- dc.l Close
- dc.l Expunge
- dc.l Null
-
- dc.l .AddUser
- dc.l .RemUser
- dc.l .PutCommand
- dc.l .CheckResult
- dc.l .WaitResult
-
- dc.l .MusicBoxCommand
- dc.l .MusicBoxCommand1
- dc.l .MusicBoxCommand2
-
- dc.l .InformationA
- dc.l .MultiRequestA
-
- dc.l .EasyCommand
- dc.l .IconifyMusicBox
- dc.l .UnIconifyMusicBox
- dc.l .IconifyArchive
- dc.l .UnIconifyArchive
- dc.l .OpenArchive
-
- dc.l .CreatePortA
- dc.l .DeletePortA
- dc.l .CreateExtIOA
- dc.l .DeleteExtIOA
- dc.l .NewListA
-
- dc.l .GetLStr
- dc.l .ErrorL
- dc.l .DisplayCatalog
- dc.l .CreateProcess
-
- dc.l .MacFormat
- dc.l .PutText
- dc.l .PutMText
- dc.l .OffsetX
- dc.l .OffsetY
-
- dc.l .SleepPointer
-
- dc.l .DeleteMMPort
- dc.l .CleanUpPort
-
- dc.l .SetupPrinter
- dc.l .PrintIt
-
- dc.l .LibVersionCheck
-
- dc.l -1
-
- DataTable:
- INITBYTE LH_TYPE,NT_LIBRARY
- INITLONG LN_NAME,LibName
- INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
- INITWORD LIB_VERSION,Version
- INITWORD LIB_REVISION,Revision
- INITLONG LIB_IDSTRING,idString
- dc.l 0
-
- InitRoutine:
- move.l a5,-(a7)
- move.l d0,a5
- move.l #0,_Catalog
- move.l #0,_Locale
- move.l a6,mbl_SysLib(a5)
- move.l a0,mbl_SegList(a5)
- move.l $4,_SysBase
- lea DosName(pc),a1
- move.l #37,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_DosLib(a5)
- move.l d0,_DOSBase
- bne.s 1$
- move.l #0,a5
- bra InitRoutine_end
- 1$:
- lea GfxName(pc),a1
- move.l #37,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_GfxLib(a5)
- move.l d0,_GfxBase
- bne.s 2$
- move.l #0,a5
- bra InitRoutine_end
- 2$:
- lea IntName(pc),a1
- move.l #37,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_IntLib(a5)
- move.l d0,_IntuitionBase
- bne.s 3$
- move.l #0,a5
- bra InitRoutine_end
- 3$:
- lea FontName(pc),a1
- move.l #37,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_FontLib(a5)
- move.l d0,_DiskfontBase
- bne.s 4$
- move.l #0,a5
- bra InitRoutine_end
- 4$:
- lea LocName(pc),a1
- move.l #38,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_LocLib(a5)
- move.l d0,_LocaleBase
- 5$:
- lea GTName(pc),a1
- move.l #37,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_GTLib(a5)
- move.l d0,_GadToolsBase
- bne.s 6$
- move.l #0,a5
- bra InitRoutine_end
- 6$:
- lea VerName(pc),a1
- move.l #0,d0
- CALLSYS OpenLibrary
- move.l d0,mbl_VerLib(a5)
- move.l d0,_VersionBase
- 7$:
-
- movem.l d0-d7/a0-a6,-(sp)
- ; ------------------------------------
- move.l #0,a0
- move.l _LocaleBase,a6
- cmpa.l #0,a6
- beq 10$
- jsr _LVOOpenLocale(a6)
- move.l d0,_Locale
- tst.l d0
- beq 10$
- move.l d0,a0
- move.l #CatName,a1
- move.l #0,a2
- jsr _LVOOpenCatalogA(a6)
- move.l d0,_Catalog
- 10$:
- ; ------------------------------------
- jsr _InitSleepPointer(pc)
- movem.l (sp)+,d0-d7/a0-a6
-
- InitRoutine_end
- move.l a5,d0
- move.l (a7)+,a5
- rts
-
- Open:
- addq.w #1,LIB_OPENCNT(a6)
- bclr #LIBB_DELEXP,mbl_Flags(a6)
- move.l a6,d0
- rts
-
- Close:
- clr.l d0
- subq.w #1,LIB_OPENCNT(a6)
- bne.s 1$
- btst #LIBB_DELEXP,mbl_Flags(a5)
- beq.s 1$
- bsr Expunge
- 1$:
- rts
-
- Expunge:
- movem.l d2/a5-a6,-(a7)
- move.l a6,a5
- move.l mbl_SysLib(a5),a6
- tst.w LIB_OPENCNT(a5)
- beq.s 1$
- bset #LIBB_DELEXP,mbl_Flags(a5)
- clr.l d0
- bra Expunge_end
- 1$:
- move.l mbl_SegList(a5),d2
- move.l a5,a1
- CALLSYS Remove
- movem.l d0-a7/a0-a6,-(sp)
- ; ------------------------------------
- move.l mbl_LocLib(a5),a6
- move.l _Locale,a0
- cmpa.l #0,a0
- beq Locale_okay
- jsr _LVOCloseLocale(a6)
- move.l _Catalog,a0
- cmpa.l #0,a0
- beq Locale_okay
- jsr _LVOCloseCatalog(a6)
- Locale_okay:
- ; ------------------------------------
- movem.l (sp)+,d0-a7/a0-a6
- jsr _RemoveSleepPointer(pc)
- move.l mbl_VerLib(a5),a1
- cmpa.l #0,a1
- beq Version_okay
- CALLSYS CloseLibrary
- Version_okay:
- move.l mbl_DosLib(a5),a1
- CALLSYS CloseLibrary
- move.l mbl_IntLib(a5),a1
- CALLSYS CloseLibrary
- move.l mbl_GfxLib(a5),a1
- CALLSYS CloseLibrary
- move.l mbl_FontLib(a5),a1
- CALLSYS CloseLibrary
- move.l mbl_LocLib(a5),a1
- CALLSYS CloseLibrary
- move.l mbl_GTLib(a5),a1
- CALLSYS CloseLibrary
- clr.l d0
- move.l a5,a1
- move.w LIB_NEGSIZE(a5),d0
- sub.l d0,a1
- add.w LIB_POSSIZE(a5),d0
- CALLSYS FreeMem
- move.l d2,d0
- Expunge_end:
- movem.l (a7)+,d2/a5-a6
- rts
-
- Null:
- moveq #0,d0
- rts
-
- .AddUser:
- move.l a0,-(sp)
- jsr _AddUser(pc)
- addq.w #4,sp
- rts
-
- .RemUser:
- move.l a0,-(sp)
- jsr _RemUser(pc)
- addq.w #4,sp
- rts
-
- .PutCommand:
- move.l a0,-(sp)
- jsr _PutCommand(pc)
- addq.w #4,sp
- rts
-
- .CheckResult:
- move.l a0,-(sp)
- jsr _CheckResult(pc)
- addq.w #4,sp
- rts
-
- .WaitResult:
- move.l a0,-(sp)
- jsr _WaitResult(pc)
- addq.w #4,sp
- rts
-
- .MusicBoxCommand:
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _MusicBoxCommand(pc)
- addq.w #8,sp
- rts
-
- .MusicBoxCommand1:
- move.l d0,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _MusicBoxCommand1(pc)
- add.w #12,sp
- rts
-
- .MusicBoxCommand2:
- move.l d0,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _MusicBoxCommand2(pc)
- add.w #16,sp
- rts
-
- .InformationA:
- move.l a0,-(sp)
- jsr _InformationA(pc)
- addq.w #4,sp
- rts
-
- .MultiRequestA:
- move.l a2,-(sp)
- move.l a1,-(sp)
- move.l a0,-(sp)
- jsr _MultiRequestA(pc)
- add.w #12,sp
- rts
-
- .EasyCommand:
- move.l d2,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _EasyCommand(pc)
- add.w #16,sp
- rts
-
- .IconifyMusicBox:
- jsr _IconifyMusicBox(pc)
- rts
-
- .UnIconifyMusicBox:
- jsr _UnIconifyMusicBox(pc)
- rts
-
- .IconifyArchive:
- jsr _IconifyArchive(pc)
- rts
-
- .UnIconifyArchive:
- jsr _UnIconifyArchive(pc)
- rts
-
- .OpenArchive:
- move.l d2,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- jsr _OpenArchive(pc)
- add.w #12,sp
- rts
-
- .CreatePortA:
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _CreatePort(pc)
- addq.w #8,sp
- rts
-
- .DeletePortA:
- move.l a0,-(sp)
- jsr _DeletePort(pc)
- addq.w #4,sp
- rts
-
- .CreateExtIOA:
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _CreateExtIO(pc)
- addq.w #8,sp
- rts
-
- .DeleteExtIOA:
- move.l a0,-(sp)
- jsr _DeleteExtIO(pc)
- addq.w #4,sp
- rts
-
- .NewListA:
- move.l a0,-(sp)
- jsr _NewList(pc)
- addq.w #4,sp
- rts
-
- .GetLStr:
- move.l a0,-(sp)
- move.l d0,-(sp)
- jsr _GetLStr(pc)
- addq.w #8,sp
- rts
-
- .ErrorL:
- move.l a0,-(sp)
- move.l d0,-(sp)
- jsr _ErrorL(pc)
- addq.w #8,sp
- rts
-
- .DisplayCatalog:
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _DisplayCatalog(pc)
- addq.w #8,sp
- rts
-
- .CreateProcess:
- move.l d2,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _CreateProcess(pc)
- add.w #16,sp
- rts
-
- .MacFormat:
- move.l d0,-(sp)
- move.l a1,-(sp)
- move.l a0,-(sp)
- jsr _MacFormat(pc)
- add.w #12,sp
- rts
-
- .PutText:
- move.l a1,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _PutText(pc)
- add.w #16,sp
- rts
-
- .PutMText:
- move.l d2,-(sp)
- move.l a1,-(sp)
- move.l d1,-(sp)
- move.l d0,-(sp)
- move.l a0,-(sp)
- jsr _PutMText(pc)
- add.w #20,sp
- rts
-
- .OffsetX:
- move.l a0,-(sp)
- jsr _OffsetX(pc)
- addq.w #4,sp
- rts
-
- .OffsetY:
- move.l a0,-(sp)
- jsr _OffsetY(pc)
- addq.w #4,sp
- rts
-
- .SleepPointer
- move.l a0,-(sp)
- jsr _SleepPointer(pc)
- addq.w #4,sp
- rts
-
- .DeleteMMPort:
- move.l a0,-(sp)
- jsr _DeleteMMPort(pc)
- addq.w #4,sp
- rts
-
- .SetupPrinter
- jsr _SetupPrinter(pc)
- rts
-
- .PrintIt:
- move.l a1,-(sp)
- move.l a0,-(sp)
- jsr _PrintIt(pc)
- addq.w #8,sp
- rts
-
- .CleanUpPort:
- move.l a0,-(sp)
- jsr _CleanUpPort(pc)
- addq.w #4,sp
- rts
-
- .LibVersionCheck:
- move.l d0,-(sp)
- jsr _LibVersionCheck(pc)
- addq.w #4,sp
- rts
-
- global _GfxBase,4
- global _IntuitionBase,4
- global _DOSBase,4
- global _DiskfontBase,4
- global _SysBase,4
- global _LocaleBase,4
- global _GadToolsBase,4
- global _VersionBase,4
-
- global _Catalog,4
- global _Locale,4
-
- END
-
-